package org.femto.math.vis;

import javax.media.opengl.GL;
import org.femto.math.linalg.Matrix4x4;
import org.femto.math.linalg.Vec3;

public class FieldOfView implements Manipulator {

    private double dfov = 0;
    private Vec3 p0;
    private Vec3 p1;
    private double dfovCoeff = 30;

    public void beginDrag(Vec3 p) {
        p1 = p;
        p0 = p1;
    }

    public void drag(Vec3 p) {
        p0 = p1;
        p1 = p;
        dfov = p1.v[1]-p0.v[1];
    }

    public void endDrag(Vec3 p) {
        p0 = p;
        p1 = p;
    }

    public Matrix4x4 getTransform() {
        return new Matrix4x4(new Vec3(dfovCoeff*dfov, 0, 0));
    }

    public void move(Vec3 p) {
    }

    public void render(GL gl) {
    }

}
